package com.gopay.scheduler.job;

import java.util.Date;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.gopay.common.util.CalendarUtils;
import com.gopay.remote.cps.ic.InnerCheckRemoteService;
import com.gopay.scheduler.GopayBaseJob;

/**
 * 成功订单校验定时任务
 * @IcOrderDailyJob.java
 * @author liuyu
 * @2016年12月25日 下午2:00:00  www.gopay.com.cn Inc.All rights reserved.
 */
public class IcSuccessOrderJob extends GopayBaseJob {

    private Logger logger = LoggerFactory.getLogger(this.getClass());
    
    @Resource(name = "InnerCheckRemoteService")
    private InnerCheckRemoteService innerCheckRemoteService;

    @Override
    protected void doJobInternal() {
        try {
            logger.info("前一日成功订单校验开始！");
            Date date = CalendarUtils.getNextDate(new Date(), -1);
            innerCheckRemoteService.checkSuccessOrderAndAccounting(false, date);
            logger.info("前一日成功订单校验结束！");
        } catch (Exception e) {
            logger.error("校验过程出错！", e);
        }
    }


}
